﻿@using VirtualPress.Infrastructure.Entities.Entity;
@{
    Periodical journal = ViewBag.Journal;
    ViewBag.Title = "期刊初始化";
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
<div id="content-header">
    <h1>
        初始化期刊设置</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/Home" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a
        class="current">期刊初始化</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-pencil"></i></span>
                    <h5>
                        初始化期刊设置</h5>
                    <h5 style="float: right; color: Red;">
                    </h5>
                </div>
                <div class="alert alert-info">
                    <strong>期刊初始化!</strong> 请先初始化设置您的期刊
                </div>
                <div class="widget-content nopadding">
                    <form id="installform" class="form-horizontal" method="post" enctype="multipart/form-data"
                    action="/WorkSpace/Console/install">
                    <input type="hidden" name="journal" value="@journal.Id" />
                    <div class="control-group">
                        <label class="control-label">
                            登录密码
                        </label>
                        <div class="controls">
                            <input type="password" id="iptPassword" placeholder="密码长度6-20位" name="Password" class="{required:true,minlength:6,maxlength:20}" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            确认密码
                        </label>
                        <div class="controls">
                            <input type="password" id="iptPasswordAgain" placeholder="请确保两次输入一致" name="confirm"
                                class="{required:true,equalTo:'#iptPassword'}" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            默认审回时间 (天)
                        </label>
                        <div class="controls">
                            <input name="DefaultExamineDay" class="{required:true,digits:true}" type="text" value="@journal.DefaultExamineDay" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            稿件基准页数
                        </label>
                        <div class="controls">
                            <input name="ManuscriptPageSize" class="{required:true,digits:true}" type="text" value="@journal.ManuscriptPageSize" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            是否收取专审费用
                        </label>
                        <div class="controls">
                            <select name="isFeeForExpertExmaine" onchange="changeFeeSet(this)">
                                <option value="true" selected="selected">收费</option>
                                <option value="false">不收费</option>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            基准专审费用
                        </label>
                        <div class="controls">
                            <input id="txtPagePrice" name="PagePrice" class="{required:true,digits:true}" type="text" value="@journal.PagePrice" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            超页价格
                        </label>
                        <div class="controls">
                            <input name="PricePerPrice" class="{required:true,digits:true}" type="text" value="@journal.PricePerPrice" />
                            <span>每超过1页价格</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            基准出版版面费
                        </label>
                        <div class="controls">
                            <input name="PublicationPrice" class="{required:true,digits:true}" type="text" value="@journal.PublicationPrice" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            征稿启事
                        </label>
                        <div class="controls">
                            <script name="Announcement" id="txtAnnouncement" type="text/plain">@Html.Raw(journal.CallForPaper)</script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            作者须知
                        </label>
                        <div class="controls">
                            <script name="Attention" id="txtAttention" type="text/plain">@Html.Raw(journal.Attention)</script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            征稿范围
                        </label>
                        <div class="controls">
                            <textarea class="{required:true}" cols="20" rows="10" name="ZGFW">@journal.ZGFW</textarea>
                            <label>
                                本期刊的征稿范围。多个范围用 ';' 分割</label>
                        </div>
                    </div>
                    <div class="form-actions">
                        <a class="btn btn-primary" href="/workspace/console/index">返回</a>
                        <input id="next" class="btn btn-primary" type="submit" value="保存" />
                    </div>
                    <div id="submitted">
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section tail
{
    <script type="text/javascript" src="/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/scripts/unicorn.wizard.js"></script>
    <script type="text/javascript" src="/scripts/jquery.metadata.js"></script>
    <script type="text/javascript" src="/scripts/jquery.wizard.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Scripts/UEditor/editor_config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Scripts/UEditor/editor_all_min.js"></script>
    <script type="text/javascript">
        var announcement = UE.getEditor('txtAnnouncement');
        var attention = UE.getEditor('txtAttention');
        $(function () {
            $('#installform').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                },
                submitHandler: function (form) {
                    if (announcement.getContent() == '' || attention.getContent() == '') {
                        alert('请完善表格');
                        return false;
                    }
                }
            });
        });
        function changeFeeSet(sender) {
            var val = $(sender).val();
            if (/false/i.test(val)) {
                $('#txtPagePrice').attr('disabled', 'disabled');
            }
            else {
                $('#txtPagePrice').removeAttr('disabled', 'disabled');
            }
        }
    </script>
}
